net: ena: fix incorrect update of intr_delay_resolution
authorArthur Kiyanovski <akiyano@amazon.com>
Mon, 16 Sep 2019 11:31:36 +0000 (14:31 +0300)
committerSalvatore Bonaccorso <carnil@debian.org>
Sat, 7 Dec 2019 12:24:06 +0000 (12:24 +0000)
commit39712049014542f2e2e09aa480b52d4813a662ce
tree980376a6b8131cf1426d109eac05f8e4ce04d762
parent67305fc58af2cfb484cc1d8d9612f7fc7297696f
net: ena: fix incorrect update of intr_delay_resolution

ena_dev->intr_moder_rx/tx_interval save the intervals received from the
user after dividing them by ena_dev->intr_delay_resolution. Therefore
when intr_delay_resolution changes, the code needs to first mutiply
intr_moder_rx/tx_interval by the previous intr_delay_resolution to get
the value originally given by the user, and only then divide it by the
new intr_delay_resolution.

Current code does not first multiply intr_moder_rx/tx_interval by the old
intr_delay_resolution. This commit fixes it.

Also initialize ena_dev->intr_delay_resolution to be 1.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gbp-Pq: Topic features/all/ena
Gbp-Pq: Name 0012-net-ena-fix-incorrect-update-of-intr_delay_resolutio.patch
drivers/net/ethernet/amazon/ena/ena_com.c
drivers/net/ethernet/amazon/ena/ena_com.h
drivers/net/ethernet/amazon/ena/ena_netdev.c